package ch6.test;


//定义一个点类Point，包含2个成员变量x、y分别表示x和y坐标，2 个构造器Point()和Point(int x0,y0),
//以及一个movePoint（int dx,int dy）方法实现点的位置移动，创建两个Point对象p1、p2，
//分 别调用movePoint方法后，打印p1和p2的坐标。[必做题]
public class Point {
	
	int x0;
	int y0;
	
	public Point() {
		
	}
	
	public Point(int x0,int y0) {
		
		this.x0 = x0;
		this.y0 = y0;
	}
	public void movePoint(int dx,int dy) {
		this.x0 = dx+x0;
		this.y0 = dy+y0;
		System.out.println(x0+","+y0);
	}
	

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Point po1 = new Point();
		po1.movePoint(1, 4);
		
		Point po2 = new Point();
		po2.movePoint(2, 5);
		
	}

}
